The present invention relates generally to an input/output control method with a cache memory, a control apparatus or controller in which the control method is adopted and a computer system which incorporates the control apparatus. More particularly, the present invention is concerned with a cache managing or controlling technique for a disc controller equipped with a cache memory.
As one of the cache managing or controlling techniques for a disc controller equipped with a cache known heretofore, there may be mentioned a system disclosed in JP-A-55-117780 according to which slots, i.e. data storage units for the cache memory are managed with the aid of a single LRU (Least Recently Used) chain. Correspondence relation is established between the individual slots and tracks of a disc unit which is under the control of the disc controller. Upon reception of data to be written in the disc unit (hereinafter also referred to as the write data) from a HOST system, the disc controller writes the data not only in the cache but also in the disc unit. Accordingly, coincidence is always found between the content of the cache and that of the disc unit.
When new data is to be written in the cache from the disc unit through the disc controller, the slot which has not been accessed by a HOST system for the longest period (i.e. the LRU slot) is selected to be placed with the new data. For selecting the slot remaining unaccessed for the longest period, the LRU chain mentioned above is made use of.
In JP-A-59-33689, there is disclosed a method of allocating the data storage units or slots to a disc cache memory. However, neither disclosure nor suggestion is found in this publication concerning a managing technique or structure of the data storage units or slots in this publication.
There is disclosed in JP-A-59-15563 a technique for imparting a write-pending function to the disc controller. With the phrase "write-pending function", it means the function or capability of writing data in the disc unit after the time point at which the so-called write data are written in the cache through the disc controller. In this conjunction, it is noted that when the write-pending function is provided, the content of the cache does not always coincide with that of the disc unit. Under the circumstances, a nonvolatile memory is incorporated in the disc controller independent of the cache to thereby allow the write data to be stored in duplicate in both the nonvolatile memory and the cache memory in an effort to ensure the reliability of the content of the cache.
The prior art techniques and in particular the system imparted with the write-pending function mentioned above suffer from problems such as described below.
First, there arises such a possibility that at the time point when a slot is selected to be allocated to a new track on a disc by the disc controller (hereinafter also referred to simply as the controller), the data which has not yet been written in the disc unit (also referred to simply as the disc) may remain in the slot. Such data is termed write-pending data. When the write-pending data exists in the slot, it is required to write once the write-pending data in the disc. Consequently, the time taken for writing the write-pending data involves a waiting time in the slot allocation.
When a plurality of discs are connected to a single controller, it is desirable or necessary to control the discs in parallel for the purpose of enhancing the efficiency or performance of the whole system. In order to realize such parallel control of the discs in a facilitated manner, it becomes an important matter to make available a novel managing and controlling method for the discs and the disc cache (also referred to simply as cache).
A next problem to be solved is seen in what apportionment there should be stored in the cache the data already written in the disc and the write-pending data. The problem of such data apportionment bears more or less dependency to the quantity or amount of data for storage (memory capacity), a time period during which the data is stored in the cache or a period for which no access is made.
In the case where the nonvolatile memory is provided, a problem to be solved is encountered when the capacity of the nonvolatile memory is smaller than that of the cache. In that case, the total amount of the data not yet written in the disc (hereinafter also referred to as the write-pending data) must not exceed the capacity of the nonvolatile memory. Otherwise, provision of the nonvolatile memory would be purposeless or meaningless. Accordingly, the cache management and control need to be realized by taking into consideration the restriction imposed on the capacity mentioned above.